//
//  BrandTopViewController.m
//  SYiDaiy
//
//  Created by dllo on 16/9/10.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "BrandTopViewController.h"
#import "CustomWebview.h"
#import "AFNetworking.h"
#import "MoreESRootClass.h"
#import "MoreBanner_Brand.h"
@interface BrandTopViewController ()
@property (nonatomic,strong) MoreESRootClass *moreESRootClass;
@end

@implementation BrandTopViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    [self createwebview];
}

- (void)createwebview
{
    CustomWebview *webview = [[CustomWebview alloc] initWithFrame:self.view.bounds];
    [webview passStr:_moreESRootClass.banner_brand[2].url];
    
    [self.view addSubview:webview];
    [self moreNetworkGet];

}

#pragma mark -----more网络请求
- (void)moreNetworkGet
{
    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
    NSString *requestURLString = @"http://watch-cdn.idailywatch.com/app/watch/honored?ver=iphone&app_ver=15&lang=zh-Hans-CN";
    
    manager.requestSerializer = [AFJSONRequestSerializer serializer];
    manager.requestSerializer.timeoutInterval = 0;
    manager.responseSerializer = [AFJSONResponseSerializer serializer];
    [manager GET:requestURLString parameters:nil progress:^(NSProgress * _Nonnull downloadProgress) {
        
    } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        NSDictionary *dic = [NSDictionary dictionary];
        dic = responseObject;
        _moreESRootClass = [MoreESRootClass modelWithDic:dic];
        
        
        
        //        NSLog(@"%@",_moreESRootClass.banner_brand[2].pic);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    }];
    
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
